import java.util.Scanner;

public class MC042401序列 {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = input.nextInt();
        }
        int maxLength = 1;
        int left = 0;
        for (int right = 1; right < n; right++) {
            if (arr[right] == arr[right - 1]) {
                left = right;
            }
            maxLength = Math.max(maxLength, right - left + 1);
        }
        System.out.println(maxLength);
        input.close();
    }
}
